package org.hfchunya.mutualHelp.modular.system.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.hfchunya.mutualHelp.modular.system.entity.TeamMembers;
import org.hfchunya.mutualHelp.modular.system.mapper.TeamMembersMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 杨凯程
 * @since 2019-05-08
 */
@Service
public class TeamMembersService extends ServiceImpl<TeamMembersMapper, TeamMembers>  {
    @Resource
    private TeamMembersMapper teamMembersMapper;
    public int deleteByPrimaryKey(Integer id){

        return teamMembersMapper.deleteById(id);
    };

    public int insert(TeamMembers record){

        return teamMembersMapper.insert(record);
    };


    public TeamMembers selectByPrimaryKey(Integer id){

        return teamMembersMapper.selectById(id);
    };

    public int updateByPrimaryKeySelective(TeamMembers record){
        return teamMembersMapper.updateById(record);
    };

    public List<TeamMembers> getList(){

        return teamMembersMapper.selectList(null);
    };

    public List<TeamMembers> selectlist(TeamMembers record){
        HashMap<String,Object> map = new  HashMap<String,Object>();
        if(record.getName()!=null&&!"".equals(record.getName())){
            map.put("name",record.getName());
        }
        return teamMembersMapper.selectByMap(map);
    };

}
